<template>
  <!-- 导航内容 -->
  <div class="content">
    <!-- 滚动区域 插件 -->
    <scroller :on-refresh="refresh" class="scrollerBox">
      <!--  -->
      <div
        class="moduleBox"
        v-for="(itemFa, index) in $parent.$parent.$parent.infoList"
        :key="itemFa.__ob__.dep.id"
        ref="moduleBox"
        v-show="isShow === index"
      >
        <!-- 图片标题 -->
        <div class="headImg" v-if="itemFa.mainImgUrl">
          <img v-lazy="itemFa.mainImgUrl" alt="" />
        </div>
        <!-- 内容 -->
        <lazy-component>
          <div
            class="detContent"
            v-for="(item, index) in itemFa.list"
            :key="index"
          >
            <p class="title">{{ item.title }}</p>
            <ul class="ulList">
              <li v-for="(itemCh, index) in item.productList" :key="index">
                <div class="img">
                  <img v-lazy="itemCh.imgUrl" alt="" />
                </div>
                <p>{{ itemCh.title }}</p>
              </li>
            </ul>
          </div>
        </lazy-component>
      </div>
      <!--  -->
    </scroller>
  </div>
</template>

<script>
export default {
  data() {
    return {
      temp: 0,
    };
  },
  props: ["isShow"],
  methods: {
    refresh(done) {
      setTimeout(() => {
        let start = this.top - 1;
        for (let i = start; i > start - 10; i--) {
          this.items.splice(0, 0, i + " - keep walking, be 2 with you.");
        }
        this.top = this.top - 10;
        done();
      }, 1500);
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  box-sizing: border-box;
  height: 100%;
  overflow: hidden;
  .scrollerBox {
    position: absolute;
    right: 11px;
    top: 56px;
    left: 30%;
    width: 70% !important;
    height: calc(100% - 106px) !important;
    padding: 0 11px;
    box-sizing: border-box;
  }
  .headImg {
    width: 100%;
    height: 91px;
    background-color: #ccc;
    img {
      width: 100%;
      height: 100%;
    }
  }

  .detContent {
    .title {
      padding: 22px 0;
      font-size: 18px;
      text-align: left;
    }
    .ulList {
      display: flex;
      flex-wrap: wrap;
      li {
        width: 33%;
        height: 114px;
        margin-bottom: 11px;
        .img {
          display: flex;
          justify-content: center;
          align-items: center;
          width: 100%;
          height: 89px;
          img {
            width: 89px;
            height: 89px;
          }
        }
        p {
          width: 100%;
          height: 21px;
          font-size: 16px;
        }
      }
    }
  }
}
</style>
